home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer 7.11 / 2002-01_-_Disc_7.11.iso / Data / items_bak.pcg / scripts / DefineButton2_276 / BUTTONCONDACTION on(release, keyPress Enter).as < prev    next >
Text File  |  2001-10-11  |  2KB  |  68 lines

  1. on(release, keyPress "<Enter>"){
  2.    if(searchstr != "")
  3.    {
  4.       charCounter = 0;
  5.       recordsFound = true;
  6.       j = searchstr.length - 1;
  7.       arGamesDBMain = arGamesDBMaster;
  8.       arGamesDBIndex = arGamesIndexMaster;
  9.       tempsearchstr = searchstr.toUpperCase();
  10.       while(j >= charCounter)
  11.       {
  12.          arGamesDBTemp = new Array();
  13.          arGamesIndexTemp = new Array();
  14.          i = 0;
  15.          iSlice = 0;
  16.          k = arGamesDBMain.length - 1;
  17.          while(k >= i)
  18.          {
  19.             tempstr = arGamesDBMain[i].toUpperCase();
  20.             if(tempstr.charAt(charCounter) == tempsearchstr.charAt(charCounter))
  21.             {
  22.                arGamesDBTemp[iSlice] = arGamesDBMain[i];
  23.                arGamesIndexTemp[iSlice] = arGamesDBIndex[i];
  24.                iSlice += 1;
  25.             }
  26.             i += 1;
  27.          }
  28.          charCounter += 1;
  29.          if(arGamesDBTemp.length == 0)
  30.          {
  31.             recordsFound = false;
  32.             break;
  33.          }
  34.          arGamesDBMain = arGamesDBTemp;
  35.          arGamesDBIndex = arGamesIndexTemp;
  36.       }
  37.       if(recordsFound)
  38.       {
  39.          TheCurrentitem = 0;
  40.          TopItem = 1;
  41.          GameBox_y = 224;
  42.          arGamesDBSlice = arGamesDBTemp;
  43.          arGamesIndexSlice = arGamesIndexTemp;
  44.          var i = 1;
  45.          while(scrollMax >= i)
  46.          {
  47.             set("menugame" + i,arGamesDBSlice[i - 1]);
  48.             set("gamenumber" + i,i);
  49.             i += 1;
  50.          }
  51.          if(dbCount == currentGameCount)
  52.          {
  53.             setProperty("itemBar" + lastGameBox, _alpha, 10);
  54.          }
  55.          setProperty("itemBar1", _alpha, 20);
  56.          theCurrentGame = arGamesDBIndex[0];
  57.          numitems = arGamesDBSlice.length;
  58.          num_Games = numitems;
  59.          lastButton = 1;
  60.          topDB = 1;
  61.          dbCount = 1;
  62.          currentGameCount = 1;
  63.          lastGameBox = 1;
  64.          gotoAndPlay(13);
  65.       }
  66.    }
  67. }
  68.